//
//  UIBarButtonItem+Item.m
//  weibo
//
//  Created by 胡金东 on 16/2/24.
//  Copyright © 2016年 胡金东. All rights reserved.
//

#import "UIBarButtonItem+Item.h"

@implementation UIBarButtonItem (Item)

+(UIBarButtonItem *)itemWithTarget:(id)target action:(SEL)action image:(NSString *)image HighImage:(NSString *)highImage
{
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    [btn setBackgroundImage:[UIImage imageNamed:image]forState:UIControlStateNormal];
    [btn setBackgroundImage:[UIImage imageNamed:highImage] forState:UIControlStateHighlighted];
    [btn sizeToFit];
    return [[UIBarButtonItem alloc]initWithCustomView:btn];
}

@end
